from pygds import GDS

URI = "bolt://localhost:7687"
AUTH = ("neo4j", "123456")

with GDS(URI, auth=AUTH) as gds:
    # create the projected graph
    # NB: make sure a graph with the same does not already exists
    # otherwise run CALL gds.graph.drop("MyGraph")
    gds.graph.drop("MyGraph")
    gds.graph.create(
        "MyGraph",
        {
            "Company": {
                "label": '企业'
            },
            "Segment": {
                "label": '工程项目标段'
         }
  }, {
    "bid": {
      "type": '投标',
      "orientation": 'UNDIRECTED'
    }
}
    )

    result = gds.fastRP.stream(
        "MyGraph",
        {
            #"walksPerNode": 6,
            "embeddingDimension": 64
        }
    )

    import pandas as pd

    _tmp = pd.DataFrame.from_records(result)
    df = pd.DataFrame(_tmp["embedding"].tolist())
    print(df.head())
    gds.graph.drop("MyGraph")